DEFINITION MODULE String;
(*      File name: String.def                                   *)
(*      Creation : March,1985                                   *)
(*      Function : String function for Modula-2/68              *)
(*      By       : Stan                                         *)
(*                                                              *)

(*
*    Copyright (c) 1985,1986,1987,1988,1989 by
*    ana-systems, Foster City, California.
*    All Rights Reserved.
*
*    This software is furnished under a license and may be used and copied
*    only  in accordance with  the  terms  of  such  license and  with the
*    inclusion of the above copyright notice.  This software or  any other
*    copies thereof may not be provided or otherwise made available to any
*    other  person.   No title to and ownership of the  software is  herby
*    transferred.
*
*    The information in this software is  subject to change without notice
*    and  should  not be construed as a commitment by ana-systems.   No
*    warranty is implied or expressed.
*
*  SCCID  = "1.1    1/26/86"; 
*)
(*      History of modifcation                                  *)
(*      Date            Who             Why                     *)
(*                                                              *)

EXPORT QUALIFIED 
        CompareResult,
        Length,         Assign,         Insert,         Delete,
        Position,       Substring,      Compare,        Concat;

TYPE
        CompareResult = ( less, equal, greater);

PROCEDURE Assign ( VAR  source  : ARRAY OF CHAR;
                   VAR dest    : ARRAY OF CHAR;
                   VAR success : BOOLEAN );
(* Assign array of char source to array of char dest. If copy is successful,
  success will be true otherwise false.
  If array of char dest is smaller than source, copy will exit with out
  any copying
 *)

PROCEDURE Length ( VAR str : ARRAY OF CHAR ) : CARDINAL;

PROCEDURE Insert ( VAR source  : ARRAY OF CHAR;
                   VAR dest    : ARRAY OF CHAR;
                       index   : CARDINAL;
                   VAR success : BOOLEAN );

PROCEDURE Delete ( VAR str     : ARRAY OF CHAR;
                       index   : CARDINAL;
                       len     : CARDINAL;
                   VAR success : BOOLEAN );

PROCEDURE Position ( VAR pattern : ARRAY OF CHAR;
                      VAR source  : ARRAY OF CHAR;
                      VAR index   : CARDINAL;
                      VAR found   : BOOLEAN );

PROCEDURE Substring ( VAR    source : ARRAY OF CHAR;
                          index  : CARDINAL;
                          len    : CARDINAL;
                      VAR dest   : ARRAY OF CHAR;
                      VAR success : BOOLEAN );
 
PROCEDURE Concat ( VAR source1 : ARRAY OF CHAR;
                   VAR source2 : ARRAY OF CHAR;
                   VAR dest    : ARRAY OF CHAR;
                   VAR success : BOOLEAN );

PROCEDURE Compare ( VAR string1 : ARRAY OF CHAR;
                    VAR string2 : ARRAY OF CHAR) : CompareResult;

END String.
